﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public partial class HairGen
{
    //[ShowToggle("显示骨骼")]
    //bool showBoneMesh;
    //void showBoneMesh_Changed(bool value)
    //{
    //    foreach (var rd in GetComponentsInChildren<RigDraw>(true))
    //    {
    //        rd.enabled = value;
    //    }
    //}
    [Inline(0)]
    [ShowToggle("投射头发（P）")]
    bool snapToSurf;

    [Inline(0)]
    [ShowToggle("延长头发（L）")]
    bool append;

    [Inline(1)]
    [ShowToggle("镜像（F）")]
    bool mirror;
    void mirror_Changed(bool value)
    {
        //showXBoard = false;
        //showXBoard_Changed(false);
    }
    [Inline(1)]
    [ShowToggle("显示挡板（B）")]
    bool showXBoard;
    void showXBoard_Changed(bool value)
    {
        //TransformTool.SearchScnRoot("XBoard").gameObject.SetActive(value);
        TransformTool.SearchScn("XBoard").gameObject.SetActive(value);
    }

    [Inline(2)]
    [ShowToggle("编辑曲线（Tab）")]
    bool editCurve;
    void editCurve_Changed(bool value)
    {
        if (value && hairCurr != null)
        {
            GizmosAxis.I.transform.rotation = Quaternion.AngleAxis(hairCurr.curveData.circleAngle, Vector3.up);
        }
        Selector.I.enabled = !value;
        GizmosAxis.I.gameObject.SetActive(value);
        Curve3Edit.I.EditCurve = value;
        _poseScale = poseScale = 1;
    }
    [Inline(2)]
    [ShowToggle("显示曲线（D）")]
    bool showCurveUI;
    public bool snap = true;
    public Vector2 remapMax = new Vector2(1f, 0.2f);
    public Vector2 remapMin = new Vector2(0, 0);
    public int count = 10;
    public List<Vector2> l;
    public List<Vector2> uvs;
    public UnityChan.SpringManager springMgr;

    [ShowButton]
    void Test()
    {
        l = new List<Vector2>();
        for (int i = 0; i < count; i++)
        {
            l.Add(i * Vector2.one);
        }
        l.Remap(remapMin, remapMax);
    }
    void showCurveUI_Changed(bool value)
    {
        UICurve.I.gameObject.SetActive(value);
    }
}
